/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.dinner.entity.order;

import org.hibernate.validator.constraints.Length;
import com.thinkgem.jeesite.modules.sys.entity.User;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.List;
import com.google.common.collect.Lists;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 订单管理Entity
 * @author dai
 * @version 2018-11-26
 */
public class ResOrder extends DataEntity<ResOrder> {
	
	private static final long serialVersionUID = 1L;
	private String number;		// 订单编号
	private String shopId;		// 店铺
	private User user;		// 单下用户
	private String price;		// 订单价格
	private String favorablePrice;		// 优惠价格
	private Date sendTime;		// 派送时间
	private String sendPrice;		// 送派费用
	private String payWay;		// 支付方式
	private List<ResOrderDetail> resOrderDetailList = Lists.newArrayList();		// 子表列表
	
	public ResOrder() {
		super();
	}

	public ResOrder(String id){
		super(id);
	}

	@Length(min=1, max=200, message="订单编号长度必须介于 1 和 200 之间")
	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}
	
	@Length(min=1, max=64, message="店铺长度必须介于 1 和 64 之间")
	public String getShopId() {
		return shopId;
	}

	public void setShopId(String shopId) {
		this.shopId = shopId;
	}
	
	@NotNull(message="单下用户不能为空")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}
	
	public String getFavorablePrice() {
		return favorablePrice;
	}

	public void setFavorablePrice(String favorablePrice) {
		this.favorablePrice = favorablePrice;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getSendTime() {
		return sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}
	
	public String getSendPrice() {
		return sendPrice;
	}

	public void setSendPrice(String sendPrice) {
		this.sendPrice = sendPrice;
	}
	
	@Length(min=0, max=64, message="支付方式长度必须介于 0 和 64 之间")
	public String getPayWay() {
		return payWay;
	}

	public void setPayWay(String payWay) {
		this.payWay = payWay;
	}
	
	public List<ResOrderDetail> getResOrderDetailList() {
		return resOrderDetailList;
	}

	public void setResOrderDetailList(List<ResOrderDetail> resOrderDetailList) {
		this.resOrderDetailList = resOrderDetailList;
	}
}